package com.social.utils;

import org.springframework.util.DigestUtils;

/**
 * @BelongsProject: social
 * @BelongsPackage: com.social.utils
 * @Author: zhm
 * @CreateTime: 2022-09-27  09:48
 * @Description: TODO
 * @Version: 1.0
 */
public class MD5Utils {

    /**
     * md5算法加密
     */
    public static String getMd5Password(String password,String salt){
        for (int i = 0; i < 3; i++) {
            //三次加密
            password = DigestUtils.md5DigestAsHex((salt + password + salt).getBytes()).toUpperCase();
        }
        //返回加密的密码
        return password;
    }
}
